<#import "/spring.ftl" as spring />

<#if data??>
<@spring.bind "data" />
</#if>
<#switch type>	
	<#case 1>
		<div class="accSettingData">
	       	<div class="accSettingRow">	
	       		<span class="fl accDataL">Họ:</span>
	            <span class="fl accDataR"><@spring.formInput path="data.lastName"/></span>
	            <span class="fl accDataL">Tên đệm:</span>
	            <span class="fl accDataR"><@spring.formInput path="data.middleName"/></span>
	            <span class="fl accDataL">Tên:</span>
	            <span class="fl accDataR"><@spring.formInput path="data.firstName"/></span>
	            <span class="fl accDataL">Ngày Sinh:</span>
	            <span class="fl accDataR">	            	
	            	<select id="birthDate">
	            	<#assign x=31>
					<#list x..1 as i>
					  <option value="${i}" <#if (i==data.birthdayDate)>selected="selected"</#if> >${i}</option>
					</#list>
	            	</select>
	            	<select id="birthMonth">
	            	<#assign x=12>
					<#list x..1 as i>
					  <option value="${i}" <#if (i==data.birthdayMonth)>selected="selected"</#if>>${i}</option>
					</#list>
	            	</select>
	            	<select id="birthYear">
	            	<#assign x=1998>
					<#list x..1945 as i>
					  <option value="${i}" <#if (i==data.birthdayYear)>selected="selected"</#if>>${i}</option>
					</#list>
					</select>
	            	<@spring.formHiddenInput  path="data.birthdayDate"/>
	            	<@spring.formHiddenInput  path="data.birthdayMonth"/>
	            	<@spring.formHiddenInput  path="data.birthdayYear"/>
	            </span>
	            <span class="fl accDataL">Giới Tính:</span>
	            <span class="fl accDataR">
	            	<select id="male">
	            		<option value="true" ${data.male?string("selected='selected'","")}>Nam</option>
	            		<option value="false" ${data.male?string("","selected='selected'")}>Nữ</option>
	            	</select>	            	
	            </span>	            
	            <span class="fl accDataL">Email:</span>
	            <span class="fl accDataR"><@spring.formInput path="data.email"/></span>
	            <span class="fl accDataL">Tự bạch:</span>
	            <span class="fl accDataR"><@spring.formTextarea path="data.aboutMe"/></span>
	            <div class="clearthis"></div>
	            <p><a class="icon_1 btnUploadAvatar accSettingSaveBtn" href="javascript:updateBI()">Lưu thay đổi</a> <a href="javascript:cancelEditAS('bi')">Hủy</a></p>
	        </div>
       	</div>
	<#break>
	<#case 2>
		<div class="accSettingData">
	       	<div class="accSettingRow">	
	       		<span class="fl accDataL">Yahoo ID:</span>
	            <span class="fl accDataR"><@spring.formInput path="data.yahoo"/></span>
	            <span class="fl accDataL">Skype ID:</span>
	            <span class="fl accDataR"><@spring.formInput path="data.skype"/></span>
	            <span class="fl accDataL">Facebook:</span>
	            <span class="fl accDataR"><@spring.formInput path="data.facebook"/></span>
	            <span class="fl accDataL">ĐTDĐ</span>
	            <span class="fl accDataR"><@spring.formInput path="data.mobile"/></span>
	            <span class="fl accDataL">Website:</span>
	            <span class="fl accDataR"><@spring.formInput path="data.website"/></span>
	            <div class="clearthis"></div>
	            <p><a class="icon_1 btnUploadAvatar accSettingSaveBtn" href="javascript:updateCI()">Lưu thay đổi</a> <a href="javascript:cancelEditAS('ci')">Hủy</a></p>
	       	 </div>
       	</div>
	<#break>
	<#case 3>
		<div class="accSettingData">
			<#list schools as school>
			<div class="accSettingRow" rel="school">
				<input type="hidden" value="${school.id}" class="school_id"/>
           		<span class="fl accDataL">Trường:</span>
                <span class="fl accDataR"><input type="text" class="school_name" value="${school.name}"/></span>
                <span class="fl accDataL">Tỉnh thành:</span>
                <span class="fl accDataR">
                	<select class="school_city">
	            		<#list cities as city>
	            			<option value="${city.id}" <#if (school.cityId?? && city.id==school.cityId)>selected="selected"</#if>>${city.cityName}</option>
	            		</#list>
	            	</select>
				</span>
                <span class="fl accDataL">Chuyên ngành:</span>
                <span class="fl accDataR">
	                <select class="school_main_study">
	                </select>
	            </span>
                <span class="fl accDataL">Trình độ:</span>
                <span class="fl accDataR">
                	<select class="school_title">
                		<option>Tiến sĩ</option>
                		<option>Thạc sĩ</option>
                		<option>Cử nhân</option>
                		<option>Cao Đẵng</option>
                		<option>Trung Cấp</option>
                	</select>
                </span>
                <span class="fl accDataL">Niên khóa:</span>
                <span class="fl accDataR">
                	<select class="school_year_from">
                	<#assign x=2010>
					<#list x..1975 as i>						
	                	<option value="${i}" <#if (school.from?? && school.from==i)>selected="selected"</#if>>${i}</option>	                	
					</#list>                	 
					</select>
                	đến 
                	<select class="school_year_to">
                	<#assign x=2010>
					<#list x..1975 as i>
	                	<option value="${i}" <#if (school.to?? && school.to==i)>selected="selected"</#if>>${i}</option>	                	
					</#list>
					</select>
                </span>
            </div>
            <div class="clearthis"></div>            
            <a href="javascript:addSchool(this);" class="addDataButton">[+] Thêm Trường</a> <a href="javascript:void(0);" onClick="removeSchool(this)" class="removeDataButton">[-] Xóa Trường</a>
            </#list>           
            <#if (schools?size == 0)>
            	<div class="accSettingRow" rel="school">
					<input type="hidden" value="" class="school_id"/>
	           		<span class="fl accDataL">Trường:</span>
	                <span class="fl accDataR"><input type="text" class="school_name" value=""/></span>
	                <span class="fl accDataL">Tỉnh thành:</span>
	                <span class="fl accDataR">
	                	<select class="school_city">
		            		<#list cities as city>
		            			<option value="${city.id}">${city.cityName}</option>
		            		</#list>
		            	</select>
					</span>
	                <span class="fl accDataL">Chuyên ngành:</span>
	                <span class="fl accDataR">
		                <select class="school_main_study">		                			                
		                </select>
		            </span>
	                <span class="fl accDataL">Trình độ:</span>
	                <span class="fl accDataR">
	                	<select class="school_title">
	                		<option>Tiến sĩ</option>
	                		<option>Thạc sĩ</option>
	                		<option>Cử nhân</option>
	                		<option>Cao Đẵng</option>
	                		<option>Trung Cấp</option>
	                	</select>
	                </span>
	                <span class="fl accDataL">Niên khóa:</span>
	                <span class="fl accDataR">
	                	<select class="school_year_from">
	                	<#assign x=2010>
						<#list x..1975 as i>
		                	<option value="${i}">${i}</option>		                	
						</#list>
						</select>                	 
	                	đến 
	                	<select class="school_year_to">
	                	<#assign x=2010>
						<#list x..1975 as i>
		                	<option value="${i}">${i}</option>		                
						</#list>
						</select>
	                </span>
	            </div>
	            <div class="clearthis"></div>            
	            <a href="javascript:addSchool();" class="addDataButton">[+] Thêm Trường</a> <a href="javascript:void(0);" onClick="removeSchool(this)" class="removeDataButton">[-] Xóa Trường</a>
            </#if>         
            <div id="school_placeholder"></div>       
            <div id="school_template" style="display: none;">
            	<div class="accSettingRow" rel="school">
					<input type="hidden" value="" class="school_id"/>
	           		<span class="fl accDataL">Trường:</span>
	                <span class="fl accDataR"><input type="text" class="school_name" value=""/></span>
	                <span class="fl accDataL">Tỉnh thành:</span>
	                <span class="fl accDataR">
	                	<select class="school_city">
		            		<#list cities as city>
		            			<option value="${city.id}">${city.cityName}</option>
		            		</#list>
		            	</select>
					</span>
	                <span class="fl accDataL">Chuyên ngành:</span>
	                <span class="fl accDataR">
		                <select class="school_main_study">		                			                
		                </select>
		            </span>
	                <span class="fl accDataL">Trình độ:</span>
	                <span class="fl accDataR">
	                	<select class="school_title">
	                		<option>Tiến sĩ</option>
	                		<option>Thạc sĩ</option>
	                		<option>Cử nhân</option>
	                		<option>Cao Đẵng</option>
	                		<option>Trung Cấp</option>
	                	</select>
	                </span>
	                <span class="fl accDataL">Niên khóa:</span>
	                <span class="fl accDataR">
	                	<select class="school_year_from">
	                	<#assign x=2010>
						<#list x..1975 as i>
		                	<option value="${i}">${i}</option>		                	
						</#list>
						</select>                	 
	                	đến 
	                	<select class="school_year_to">
	                	<#assign x=2010>
						<#list x..1975 as i>
		                	<option value="${i}">${i}</option>		                
						</#list>
						</select>
	                </span>
	            </div>
	            <div class="clearthis"></div>            
	            <a href="javascript:addSchool();" class="addDataButton">[+] Thêm Trường</a> <a href="javascript:void(0);" onClick="removeSchool(this)" class="removeDataButton">[-] Xóa Trường</a>
            </div>        
            
            <#list companies as company> 
            <div class="accSettingRow" rel="company">		
            	<input type="hidden" value="${company.id}" class="company_id"/>
           		<span class="fl accDataL">Công ty:</span>
                <span class="fl accDataR"><input class="company_name" type="text" value="${company.name}"/></span>
                <span class="fl accDataL">Tỉnh thành:</span>
                <span class="fl accDataR">
                	<select class="company_city">
                	<#list cities as city>
            			<option value="${city.id}" <#if (company.cityId?? && city.id==company.cityId)>selected="selected"</#if>>${city.cityName}</option>
            		</#list>
            		</select>
                </span>
                <span class="fl accDataL">Lĩnh vực:</span>
                <span class="fl accDataR">
                	<select class="company_field"></select>
                </span>
                <span class="fl accDataL">Chức danh:</span>
                <span class="fl accDataR">
                	<select class="company_title"></select>
                </span>
                <span class="fl accDataL">Thời gian:</span>
                <span class="fl accDataR">
                	<select class="company_year_from">
                	<#assign x=2010>
					<#list x..1975 as i>						
	                	<option value="${i}" <#if (company.fromYear?? && company.fromYear==i)>selected="selected"</#if>>${i}</option>	                	
					</#list>                	 
					</select>
                	đến 
                	<select class="company_year_to">
                	<#assign x=2010>
					<#list x..1975 as i>
	                	<option value="${i}" <#if (company.toYear?? && company.toYear==i)>selected="selected"</#if>>${i}</option>	                	
					</#list>
					</select>
                </span>
            </div>
            <div class="clearthis"></div>
            <a href="javascript:addCompany();" class="addDataButton">[+] Thêm Công ty</a> <a href="javascript:void(0)" onClick="removeCompany(this);" class="removeDataButton">[-] Xóa Công ty</a>
            <br/>
            </#list>
            <#if (companies?size==0)>
            	<div class="accSettingRow" rel="company">		
	            	<input type="hidden" value="" class="company_id"/>
	           		<span class="fl accDataL">Công ty:</span>
	                <span class="fl accDataR"><input class="company_name" type="text" value=""/></span>
	                <span class="fl accDataL">Tỉnh thành:</span>
	                <span class="fl accDataR">
	                	<select class="company_city">
	                	<#list cities as city>
	            			<option value="${city.id}">${city.cityName}</option>
	            		</#list>
	            		</select>
	                </span>
	                <span class="fl accDataL">Lĩnh vực:</span>
	                <span class="fl accDataR">
	                	<select class="company_field"></select>
	                </span>
	                <span class="fl accDataL">Chức danh:</span>
	                <span class="fl accDataR">
	                	<select class="company_title"></select>
	                </span>
	                <span class="fl accDataL">Thời gian:</span>
	                <span class="fl accDataR">
	                	<select class="company_year_from">
	                	<#assign x=2010>
						<#list x..1975 as i>						
		                	<option value="${i}">${i}</option>	                	
						</#list>                	 
						</select>
	                	đến 
	                	<select class="company_year_to">
	                	<#assign x=2010>
						<#list x..1975 as i>
		                	<option value="${i}">${i}</option>	                	
						</#list>
						</select>
	                </span>
	            </div>
	            <div class="clearthis"></div>
	            <a href="javascript:addCompany();" class="addDataButton">[+] Thêm Công ty</a> <a href="javascript:void(0)" onClick="removeCompany(this);" class="removeDataButton">[-] Xóa Công ty</a>
	            </#if>
	            <div id="company_placeholder"></div>
	            <div id="company_template" style="display: none;">
	            	<div class="accSettingRow" rel="company">		
		            	<input type="hidden" value="" class="company_id"/>
		           		<span class="fl accDataL">Công ty:</span>
		                <span class="fl accDataR"><input class="company_name" type="text" value=""/></span>
		                <span class="fl accDataL">Tỉnh thành:</span>
		                <span class="fl accDataR">
		                	<select class="company_city">
		                	<#list cities as city>
		            			<option value="${city.id}">${city.cityName}</option>
		            		</#list>
		            		</select>
		                </span>
		                <span class="fl accDataL">Lĩnh vực:</span>
		                <span class="fl accDataR">
		                	<select class="company_field"></select>
		                </span>
		                <span class="fl accDataL">Chức danh:</span>
		                <span class="fl accDataR">
		                	<select class="company_title"></select>
		                </span>
		                <span class="fl accDataL">Thời gian:</span>
		                <span class="fl accDataR">
		                	<select class="company_year_from">
		                	<#assign x=2010>
							<#list x..1975 as i>						
			                	<option value="${i}">${i}</option>	                	
							</#list>                	 
							</select>
		                	đến 
		                	<select class="company_year_to">
		                	<#assign x=2010>
							<#list x..1975 as i>
			                	<option value="${i}">${i}</option>	                	
							</#list>
							</select>
		                </span>
		            </div>
		            <div class="clearthis"></div>
		            <a href="javascript:addCompany();" class="addDataButton">[+] Thêm Công ty</a> <a href="javascript:void(0)" onClick="removeCompany(this);" class="removeDataButton">[-] Xóa Công ty</a>
	            </div>
	            <div class="clearthis"></div>
	            <p><a class="icon_1 btnUploadAvatar accSettingSaveBtn" href="javascript:updateSnC()">Lưu thay đổi</a> <a href="javascript:cancelEditAS('snc')">Hủy</a></p>
			</div>
	<#break>
	<#case 4>
		<div class="accSettingData">
           	<div class="accSettingRow">	
           		<span class="fl accDataL">Địa chỉ:</span>
                <span class="fl accDataR"><@spring.formInput path="data.address"/></span>
                <span class="fl accDataL">Quận/Huyện:</span>
                <span class="fl accDataR"><@spring.formInput path="data.district"/></span>
                <span class="fl accDataL">Tỉnh thành:</span>
                <span class="fl accDataR">
                	<select id="city">
	            		<#list cities as city>
	            			<option value="${city.id}" <#if (data.cityId?? && city.id==data.cityId)>selected="selected"</#if>>${city.cityName}</option>
	            		</#list>
	            	</select>
                </span>
				<div class="clearthis"></div>
                <p><a class="icon_1 btnUploadAvatar accSettingSaveBtn" href="javascript:updateRt()">Lưu thay đổi</a> <a href="javascript:cancelEditAS('rt')">Hủy</a></p>
           	</div>
		</div>
	<#break>
	<#case 5>
		<div class="accSettingData">
           	<div class="accSettingRow">	
           		<!--span class="fl accDataL">Lĩnh vực quan tâm:</span>
                <span class="fl accDataR">
                                
                </span-->
                <span class="fl accDataL">Dòng nhạc, thể loại nhạc:</span>
                <#assign musicFav=""/>
                <#if music??>
                	<#assign musicFav=music/>
                </#if>
                <span class="fl accDataR"><input type="text" id="musicFav" value="${musicFav}" rel="music"/></span>
                <span class="fl accDataL">Thể loại phim:</span>
                <#assign movieFav=""/>
                <#if movie??>
                	<#assign movieFav=movie/>
                </#if>
                <span class="fl accDataR"><input type="text" id="movieFav" value="${movieFav}" rel="movie"/></span>
                <span class="fl accDataL">Thể loại sách, tên sách:</span>
                <#assign bookFav=""/>
                <#if book??>
                	<#assign bookFav=book/>
                </#if>
                <span class="fl accDataR"><input type="text" id="bookFav" value="${bookFav}" rel="book"/></span>
                <span class="fl accDataL">Món ăn khoái khẩu:</span>
                <#assign foodFav=""/>
                <#if food??>
                	<#assign foodFav=food/>
                </#if>
                <span class="fl accDataR"><input type="text" id="foodFav" value="${foodFav}" rel="food"/></span>
				<div class="clearthis"></div>
                <p><a class="icon_1 btnUploadAvatar accSettingSaveBtn" href="javascript:updateHb()">Lưu thay đổi</a> <a href="javascript:cancelEditAS('hb')">Hủy</a></p>
           	</div>
		</div>
	<#break>
	<#case 6>
		<div class="accSettingData">
	       	<div class="accSettingRow">	
	       		<span class="fl accDataL">Mật khẩu hiện tại:</span>
	            <span class="fl accDataR"><input type="password" id="old_password_input" name="oldPass"/><div class="error" style="display:none" id="old_password_error">Mật khẩu cũ không đúng</div><br /></span>
	            <span class="fl accDataL">Mật khẩu mới:</span>
	            <span class="fl accDataR"><input type="password" id="password_input" name="newPass"/><div class="error" style="display:none" id="password_error">Mật khẩu phải có ít nhất 5 ký tự</div><br /></span>
	            <span class="fl accDataL">Nhập lại mật khẩu mới:</span>
	            <span class="fl accDataR"><input type="password" id="password_retype_input"/><div class="error" style="display:none" id="password_retype_error">Mật khẩu không khớp</div><br /></span>
	            <div class="clearthis"></div>
	            <p><a class="icon_1 btnUploadAvatar accSettingSaveBtn" href="javascript:updatePassword()">Lưu thay đổi</a> <a href="javascript:cancelEditAS('pw')">Hủy</a></p>
	       	 </div>
       	</div>
	<#break>
</#switch>